home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / M / MacPerl 4.13 appl.sit / MacPerl ƒ / t / base / term.t < prev   
Encoding:
Text File  |  1993-10-23  |  925 b   |  43 lines  |  [TEXT/MPS ]

  1. #!./perl
  2.  
  3. # $Header: term.t,v 4.0 91/03/20 01:49:17 lwall Locked $
  4.  
  5. print "1..6\n";
  6.  
  7. # check "" interpretation
  8.  
  9. $x = "\n";
  10. if ($x lt ' ') {print "ok 1\n";} else {print "not ok 1\n";}
  11.  
  12. # check `` processing
  13.  
  14. $x = `echo hi there`;
  15. if ($x eq "hi there\n") {print "ok 2\n";} else {print "not ok 2\n";}
  16.  
  17. # check $#array
  18.  
  19. $x[0] = 'foo';
  20. $x[1] = 'foo';
  21. $tmp = $#x;
  22. print "#3\t:$tmp: == :1:\n";
  23. if ($#x == '1') {print "ok 3\n";} else {print "not ok 3\n";}
  24.  
  25. # check numeric literal
  26.  
  27. $x = 1;
  28. if ($x == '1') {print "ok 4\n";} else {print "not ok 4\n";}
  29.  
  30. # check <> pseudoliteral
  31.  
  32. open(try, "Dev:Null") || (die "Can't open Dev:Null.");
  33. if (<try> eq '') {
  34.     print "ok 5\n";
  35. }
  36. else {
  37.     print "not ok 5\n";
  38.     die "Dev:Null IS NOT A CHARACTER SPECIAL FILE!!!!\n" unless -c 'Dev:Null';
  39. }
  40.  
  41. open(try, "::Makefile") || open(try, ":::Makefile") || (die "Can't open Makefile.");
  42. if (<try> ne '') {print "ok 6\n";} else {print "not ok 6\n";}
  43.